using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DAL;
using BUS;
using Entities;
using Utility;
public partial class Admin_HinhThucThanhToanUpdate : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            LoadData();
        }

    }
    private void LoadData()
    {
        try
        {
            int id = int.Parse(Request.QueryString["id"].ToString());
            txt_id_httt.Text = id.ToString();
            tbHTThanhToan  httt = tbHTThanhToanBus .GetByID(id);
            txt_httt.Text = httt.TenHinhThuc ;

        }
        catch
        {
            Response.Redirect("HinhThucThanhToanList.aspx");
        }
    }
    protected void btn_Update_Click(object sender, EventArgs e)
    {
        int id = int.Parse(Request.QueryString["id"].ToString());
        tbHTThanhToan  httt = tbHTThanhToanBus .GetByID(id);
        httt.TenHinhThuc  = txt_httt.Text;
        tbHTThanhToanBus .Update_HTThanhtoan(httt);
        Response.Redirect("HinhThucThanhToanList.aspx");
    }
}
